import { generateRandomId } from '@/utils';
import type { BaseTableConfig } from '@/components/base-ui/base-table/type';
import { thWordLength4, thWordLength5, thWordLength7, widthLevel1, widthLevel2 } from '@/config';

export const tableConfig: BaseTableConfig = {
    items: [
        {
            modelKey: 'materialCode',
            columnProps: {
                label: '物料编码',
                width: widthLevel2
            }
        },
        {
            modelKey: 'materialName',
            columnProps: {
                label: '物料名称',
                width: widthLevel2
            }
        },
        {
            modelKey: 'classificationName',
            columnProps: {
                label: '物料分类',
                width: thWordLength4
            }
        },
        {
            modelKey: 'productionType',
            columnProps: {
                label: '生产类型',
                width: thWordLength4
            }
        },
        {
            modelKey: 'materialSpecification',
            columnProps: {
                label: '物料规格',
                width: widthLevel2
            }
        },
        {
            slotName: 'slotManufacturingStrategy',
            modelKey: 'manufacturingStrategy',
            columnProps: {
                label: '制造策略',
                width: thWordLength4
            }
        },
        {
            modelKey: 'inventory',
            columnProps: {
                label: '库存',
                width: thWordLength4
            }
        },
        {
            modelKey: 'actualInventory',
            columnProps: {
                label: '实际库存',
                width: thWordLength4
            }
        },
        {
            modelKey: 'safetyInventory',
            columnProps: {
                label: '安全库存',
                width: thWordLength4
            }
        },
        {
            modelKey: 'fixedLeadTime',
            columnProps: {
                label: '固定提前期',
                width: thWordLength5
            }
        },
        {
            modelKey: 'fixedLeadTimeBatch',
            columnProps: {
                label: '固定提前期批量',
                width: thWordLength7
            }
        },
        {
            modelKey: 'finishedProductRate',
            columnProps: {
                label: '成品率(%)',
                width: thWordLength5
            }
        },
        {
            modelKey: 'material',
            columnProps: {
                label: '材质',
                width: widthLevel2
            }
        },
        {
            modelKey: 'productUnit',
            columnProps: {
                label: '生产单位',
                width: widthLevel2
            }
        },
        {
            modelKey: 'purchaseUnit',
            columnProps: {
                label: '采购单位',
                width: widthLevel2
            }
        },
        {
            modelKey: 'creator',
            columnProps: {
                label: '创建人',
                width: widthLevel2
            }
        },
        {
            modelKey: 'createTime',
            columnProps: {
                label: '创建时间',
                width: widthLevel1
            }
        }
    ],
    unAction: false
};

export const modalMaterialConfig: BaseTableConfig = {
    items: [
        {
            modelKey: 'classificationName',
            columnProps: {
                label: '分类名称',
                width: 200
            },
            validProps: {
                id: generateRandomId(),
                required: true
            }
        },
        {
            modelKey: 'description',
            columnProps: {
                label: '描述',
                width: 200
            },
            validProps: {
                id: generateRandomId(),
                required: true
            }
        }
    ]
};
